package com.lxq.www.service;


import com.lxq.www.dao.UserRepository;
import com.lxq.www.enumeration.enumconverter.SexConverter;
import com.lxq.www.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl {

    @Autowired
    UserRepository userRepository;

    public List<User> findAllByAccount(){
        return userRepository.findAll();
    }

    public List<User> findAllBySex(String sex){
        SexConverter sexConverter=new SexConverter();
        return userRepository.findUsersBySex(sexConverter.convertToEntityAttribute(sex));
    }
}
